<?php
function index_ajax_navi(){
	if( isset($_POST['action'])&& ($_POST['action'] == 'index_ajax_navi'))
	{
		global $wpdb,$DH_page_count_limit,$DH_page_range;
		$pagei=$_GET['page'];
		$begin = ($pagei-1)*$DH_page_count_limit;
		$sql_rp = "SELECT ID, post_title,post_content
              FROM $wpdb->posts
              WHERE post_type = 'post'
              AND post_status = 'publish'
              AND post_password = ''
              ORDER BY ID DESC 
              LIMIT $begin, $DH_page_count_limit;";
		$get_recent_post = $wpdb->get_results($sql_rp);
		echo '<p class="browse">你的位置：查看全部文章（共有文章  篇）</p>';
		echo list_post($get_recent_post);
		echo '<div class="clear"></div>';
		$link=get_option("home").'/?page=';
		$max_page = get_option("dhstatic_max_page");
		$page_avi='<div class="page_navi">'.dh_pagenavi($DH_page_range,$max_page,$link,$pagei).'</div>';	
		echo $page_avi;		
		die();
	}
	else
	{
		return;
	}
}
add_action('init', 'index_ajax_navi');
?>